import * as actionTypes from "./constants";

import { Map } from "immutable";

const playerState = Map({
  songLists: [],
  songListsAll: [],
  lyric: [],
  arrId: [],
});

const a = (state = playerState, action) => {
  switch (action.type) {
    case actionTypes.PLAYDETAILACTION:
      return state.set("songLists", action.songDetails);
    case actionTypes.PLAYDETAILACTIONALL:
      return state.set("songListsAll", action.songDetailsAll);
    case actionTypes.LYRIC:
      return state.set("lyric", action.lyric);
    case actionTypes.SONGIDS:
      return state.set("arrId", action.songIds);
    case actionTypes.ADDSONGID:
      return state.set("arrId", action.addSongId);
    case actionTypes.DELETESONGIDALL:
      return state.set("arrId", action.deleteIds);
    case actionTypes.DELETESONGID:
      return state.set("arrId", action.deleteId);
    default:
      return state;
  }
};
export default a;
